<script setup>
const props = defineProps({
  item: {
    type: Object,
    default: () => {
      return {}
    }
  },
  status: {
    type: String,
    default: ''
  }
})

const { id, acceptorManagement, acceptorManagementName, acceptor, acceptorName} = props.item;
console.log("props.item", props.item);
const handleDeliver = () => {
  uni.navigateTo({
    url: `/homePages/deliverOrder/index?id=${id}&acceptorManagement=${acceptorManagement}&acceptorManagementName=${acceptorManagementName}&acceptor=${acceptor}&acceptorName=${acceptorName}`
  })
}

</script>
<template>
  <uni-card>
    <view class="listCard">
      <cell class="f-df f-jc-b">
        <text>工单等级:</text>
        <text>{{ item.levelName || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b">
        <text>工单类型:</text>
        <text>{{ item.orderName || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b">
        <text>处理人:</text>
        <text>{{ item.acceptorName || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b">
        <text>派单时间:</text>
        <text>{{ item.dispatchTime || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b" v-if="status === 'EVALUATE'">
        <text>评价内容:</text>
        <text>{{ item.orderEvaluate || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b" >
        <button type="primary" class="deliverbtn" 
          @click="handleDeliver" 
        >
          转派工单
        </button>
      </cell>
    </view>
  </uni-card>
</template>

<style lang="scss" scoped>
.listCard {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.btn-box {
  display: flex;
  justify-content: flex-end;
  margin-top: 24upx;
}
.deliverbtn {
  height: 36px;
  width: 100%;
  font-size: 14px;
  line-height: 36px;
  margin-top: 10px;
}
</style>
